# coding=utf-8
import time


def mylog(func):
    print("mylog start")

    def infunc():
        print("日志记录开始")
        func()
        print("日志记录结束")

    print("mylog end")
    return infunc


def cost_time(func):
    print("cost time start")

    def infunc():
        print("开始计时")
        start = time.time()
        func()
        end = time.time()
        print(f"耗费时间：{end - start}")

    print("cost time start")
    return infunc

# 等价于 mylog(cost_time(fun2))
@mylog
@cost_time
def fun2():
    print("fun2,start")
    time.sleep(3)
    print("fun2,end")


fun2()
